home *** CD-ROM | disk | FTP | other *** search
- -------------------------------------------------------------------------------
- ***************** ************ ******** ****** *********
- ***************** ************ ******** ****** ***********
- **** **** **** **** ** **** ****
- **** **** ** ** ** **** ****
- ********* **** ** ** ** **** ****
- **** **** ** ** ** **** ****
- **** **** ** **** **** ****
- ******* ************ ****** ******** ***********
- ******* ************ ****** ******** *********
- -------------------------------------------------------------------------------
- FIND: A utility to search any number of files for a pattern match specified on
- the command line. In addition, the following command line switches are
- available (most are the same as for the DOS FIND utility documented in
- the DOS manual):
-
- o [/v] lists all lines NOT containing pattern match
- o [/c] displays only count of lines containing pattern match
- o [/n] lists relative line number along with matching line
- o [/s] makes pattern search case sensitive (case insensitive is
- default)
- o [/a] activates a verbose reporting mode. Normally, if a file
- contains no matches, nothing is reported to the user. In
- this verbose mode, All file processing is reported.
- o [/b] allows searching binary files. The output is reported in
- byte format (HEX and ASCII) iso line format. The /n and
- /v options are disabled if this option is selected.
-
-
- Usage: find [/v][/c][/n][/s][/a][/b] "pattern" [<filespec> <filespec> ... ]
-
- (items in square brackets are optional)
-
- where <filespec> is a file specification that may contain wildcards and
- paths of the form :
-
- [d:][path]filename[.ext]
-
-
- Improvements over the original DOS filter include :
-
- o Command line parsing has been improved so that parameters can be
- entered in any order the user wishes (i.e. FIND/N/S "PATTERN" FILE.EXT
- or FIND/N FILE.EXT "PATTERN"/S are both acceptable). In addition no
- "white space" is required between the quotes for the string pattern
- and the rest of the command line (i.e. the above example could have
- been entered FIND/N/S"PATTERN"FILE.EXT).
- o File specifications may include wildcards (? or *).
- o String patterns may include wildcards (via [?] character).
- o Pattern matching is case insensitive by default. Case sensitivity can
- be restored via the [/s] switch.
- o Verbose reporting mode option via the [/a] switch. Normally files with
- no matches are not reported to the user. In this verbose mode all file
- processing is reported.
- o Ability to search binary files via the [/b] switch (output will be in
- DEBUG style HEX format). The [/v] and [/n] switches are disabled for
- this option.
- o Ability to search for special characters (via [\] char).
- o Properly treats tabs as "white space" on command line.
- o Corrects error in original FIND routine that accumulated a line count
- error every buffer refill.
- o Dynamically allocates and utilizes user's memory for buffer space to
- optimize file I/O (old routine used fixed buffers). This also reduces
- the load file size significantly.
- o Retains use of "STD" I/O devices to support redirection.
- o Structured for '.COM' format iso '.EXE'.
-
-
- Notes: If a <filespec> was not specified, it is assumed that the input to this
- program has been redirected, and thus reads its input from the 'Standard
- Input Device' (file handle 0). If there was no redirection, the program
- will detect this and output a 'Usage' error message.
-
- The specified string pattern is a normal ASCII string with the following
- exceptions (based on C language escape sequences):
-
- o [\b] will match a <BACKSPACE> character [^H]
- o [\f] will match a <FORMFEED> character [^L]
- o [\n] will match a <CR><LF> pair (NEWLINE) [^M][^J]
- o [\r] will match a <CR> character [^M]
- o [\t] will match a <TAB> character [^I]
- o [\\] will match a <BACKSLASH> character.
- o [\] followed by any character other than the above will match
- that character (i.e. [\?] or [\"] etc).
- o [?] is a positional wildcard. A [?] at any position in the
- string will match any character at that position.
-
- Note also that to maintain compatibility with the original FIND filter,
- consecutive double quotes are treated the same way as [\"] - they are
- read as a single string character and not as a string delimiter.
-
- The command line switch character can be modified via a [SWITCHAR=char]
- statement in the CONFIG.SYS file (note that this is not being officially
- supported by either Microsoft or IBM and should only be used at user's
- discretion). If the user specifies a SWITCHAR=- in the CONFIG.SYS file,
- DOS will adopt the UNIX convention for switch specification (i.e. use of
- a '-' iso '/'). This also has the side benefit of making DOS recognize a
- UNIX style directory pathname convention (i.e. paths can be specified
- with either a '/' or a '\'). This utility checks for and uses whatever
- switch character was specified to DOS via the SWITCHAR statement. Note
- also that SWITCHAR is NOT available in DOS versions 3.00 and above. In
- addition, it has been brought to my attention that certain more esoteric
- versions of DOS (i.e. CCP/M), do not have a CONFIG.SYS capability. The
- following patch will modify FIND.COM to use whatever switch character
- the user desires. It is assumed the user is familiar with the process of
- patching files with DEBUG.
-
- Location | Was | Now
- ----------------+-------------+-------------
- 0113 | CD | B2
- 0114 | 21 | 2D
-
- Location 0114 is to be changed to the ASCII code of whatever character
- is required. Hex 2D above is the ASCII code for the '-' character.
-
- Note that these locations are valid for FIND.COM Version 1.3 ONLY.
-
-
- Error messages :
-
- o 'Incorrect DOS version'
- - this utility requires DOS 2.00 or higher.
- o 'Usage: FIND [/v][/c][/n][/s][/a][/b] "pattern" [<filespec> ... ]'
- - improper command line syntax. This gives proper usage.
- o '%FIND: Syntax error in string pattern'
- - improper string specification (missing quote[s] in string).
- o '%FIND: File not found <filnam.ext>'
- - specified file not found or could not open.
- o '%FIND: Read error in <filnam.ext>'
- - encountered a read error while reading <filnam.ext>.
- o '%FIND: Invalid switch <s>'
- - specified switch is not recognized by FIND.
- o '%FIND: Insufficient memory'
- - insufficient memory for dynamic buffers (a minimum of 512 bytes are
- required AFTER the program has been loaded into memory).
- o '%FIND: Error writing to STDOUT'
- - usually get this error if STDOUT has been redirected to file and
- there is no more disk space.
-
- -------------------------------------------------------------------------------
- FIND (c) Copyright 1987 StarSoft Systems
- Version 1.3 4844 King Edward
- Fulvio J. Castelli October 1st 1987 Montreal, CANADA
- -------------------------------------------------------------------------------
- IF YOU FIND THIS UTILITY IN ANY WAY USEFUL, WE KINDLY REQUEST A CONTRIBUTION OF
- $10.00 (U.S.) SENT TO THE ABOVE ADDRESS. HAVING DONE SO, YOU WILL AUTOMATICALLY
- BECOME A REGISTERED USER, AND WILL BE ENTITLED TO ALL FURTHER UPDATES AS THEY
- ARE MADE AVAILABLE. WE ARE DISTRIBUTING THIS SOFTWARE UNDER THE 'SHAREWARE'
- PHILOSOPHY AND RELY STRICTLY ON THE SUPPORT OF OUR USERS TO MAINTAIN IT.
- -------------------------------------------------------------------------------